﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebClient
{
    public partial class _default : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["theme"] != null)
                {
                    style.Href = "styles/" + Session["theme"].ToString().ToLowerInvariant() + ".css";
                }
                else
                {
                    style.Href = "styles/light.css";
                }
            }
        }

        protected void switchDark_Click(object sender, EventArgs e)
        {
            Session["theme"] = "dark";
            style.Href = "styles/" + Session["theme"].ToString().ToLowerInvariant() + ".css";
        }

        protected void switchLight_Click(object sender, EventArgs e)
        {
            Session["theme"] = null;
            style.Href = "styles/light.css";
        }
    }
}